$(document).ready(function(){
	$("#username input")[0].focus();
	
	$("#loginForm").submit(function(){
		usernameLength = $("#username input").val().length;
		passwordLength = $("#password input").val().length;
		if(usernameLength < 4 || usernameLength > 32)
		{
			alert("用户名长度不能小于2位或大于32位");
			return false;
		} else if(passwordLength < 4 || passwordLength > 64) {
			alert("密码长度不能小于5位或大于64位");
			return false;
		}
	});
});